<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>穴位录入</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="/resources/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/resources/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <script src="/resources/js/echarts.min.js"></script>
    <link rel="stylesheet" href="/resources/css/amazeui.min.css" />
    <link rel="stylesheet" href="/resources/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="/resources/css/app.css">
    <script src="/resources/js/jquery.min.js"></script>
<style type="text/css">
</style>
</head>

<body data-type="widgets">
    <script src="/resources/js/theme.js"></script>
    <div class="am-g tpl-g">
        <%--头部开始--%>
        <%@include file="header.jsp" %>
        <%--头部结束--%>

        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-cf">穴位列表</div>
                            </div>

                                <div class="widget-body  am-fr">

                                <!-- 编辑栏 -->
                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                    <div class="am-form-group">
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <button type="button" class="am-btn am-btn-default am-btn-success" data-am-modal="{target: '#doc-modal-1', closeViaDimmer: 0}"><span class="am-icon-plus"></span> 新增</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- 下拉框 -->
                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                                    <div class="am-form-group tpl-table-list-select">
                                        <select id="searchType" data-am-selected="{btnSize: 'sm'}">
                                          <option value="acupNo">编号</option>
                                          <option value="acupName">穴位名称</option>
                                        </select>
                                    </div>
                                </div>
                                <!-- 搜索框 -->
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" id="searchContent" class="am-form-field ">
                                        <span class="am-input-group-btn">
                                            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" id="searchBtn" type="button"></button>
                                          </span>
                                    </div>
                                </div>
                                <!-- 表格显示 显示开始Java交互开始-->
                                <div class="am-u-sm-14 tableDiv">
                                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black " id="example-r">
                                        <thead >
                                            <tr>
                                                <th>穴位编号</th>
                                                <th>穴位名称</th>
                                                <th>穴位功效</th>
                                                <th>穴位说明</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <!-- 显示开始-->
                                        <tbody class="am-text-left">
                                        <c:forEach items="${pageInfo.list}" var="a">
                                            <tr>
                                                <td>${a.acupNo}</td>
                                                <td>${a.acupName}</td>
                                                <td>${a.acupEffect}</td>
                                                <td>${a.acupInstruct}</td>
                                                <td>
                                                    <div class="tpl-table-black-operation">
                                                        <a href="javascript:"  class="edit" onclick="updateAcup('${a.acupId}')" data-am-modal="{target: '#doc-modal-2', closeViaDimmer: 0}">
                                                            <i class="am-icon-pencil" >编辑</i>
                                                        </a>
                                                        <a href="javascript:" class="tpl-table-black-operation-del state" onclick="start_id(${a.acupId},${a.state})">
                                                            <!------判断------->
                                                            <c:choose>
                                                                <c:when test="${a.state == 1}">禁用</c:when>
                                                                <c:when test="${a.state == 0}">启用</c:when>
                                                            </c:choose>
                                                        </a>
                                                        <a href="javascript:" class="tpl-table-black-operation-del" onclick="acup_remov(${a.acupId})">
                                                            <i class="am-icon-trash" ></i> 删除
                                                        </a>
                                                    </div>
                                                </td>
                                            </tr>
                                        </c:forEach>
                                            <!--显示结束  -->
                                        </tbody>
                                    </table>
                                </div>
                                    <!-- 分页开始  //////  进入首页时  -->
                                    <div class="am-u-lg-12 am-cf content_pageinfor" id="div1">
                                        <!-- 分页文字信息，其中分页信息都封装在pageInfo中 -->
                                        <ul class="content_pageinfor_ul">
                                            当前第：${pageInfo.pageNum }页，总共：${pageInfo.pages }页，总共：${pageInfo.total }条记录
                                        </ul>
                                        <div class="am-fr" id="lik_id">
                                            <ul class="am-pagination tpl-pagination content_pageinfor_ul">
                                                <!-- 首页 -->
                                                <li><a href="/Acupoint/FindAcupuncturePoint?posion=1">首页</a></li>
                                                <!-- 上一页 -->
                                                <c:if test="${pageInfo.hasPreviousPage }">
                                                    <li>
                                                        <a href="/Acupoint/FindAcupuncturePoint?posion=${pageInfo.pageNum-1 }" aria-label="Previous">
                                                            <span aria-hidden="true">&laquo;</span>
                                                        </a>
                                                    </li>
                                                </c:if>
                                                <!-- 循环遍历连续显示的页面，若是当前页就高亮显示，并且没有链接 -->
                                                <c:forEach items="${pageInfo.navigatepageNums }" var="page_Num">
                                                    <c:if test="${page_Num == pageInfo.pageNum }">
                                                        <li class="am-active"><a href="/Acupoint/FindAcupuncturePoint?posion=${page_Num }">${page_Num }</a></li>
                                                    </c:if>
                                                    <c:if test="${page_Num != pageInfo.pageNum }">
                                                        <li><a href="/Acupoint/FindAcupuncturePoint?posion=${page_Num }">${page_Num }</a></li>
                                                    </c:if>
                                                </c:forEach>
                                                <!-- 下一页 -->
                                                <c:if test="${pageInfo.hasNextPage }">
                                                    <li>
                                                        <a href="/Acupoint/FindAcupuncturePoint?posion=${pageInfo.pageNum+1 }" aria-label="Next">
                                                            <span aria-hidden="true">&raquo;</span>
                                                        </a>
                                                    </li>
                                                </c:if>
                                                <!-- 末页 -->
                                                <li><a href="/Acupoint/FindAcupuncturePoint?posion=${pageInfo.pages }">末页</a></li>
                                            </ul>
                                        </div>
                                    </div>
                                    <!-----------分页面结束-------->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 添加模态框开始 -->
        <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1">
            <div class="am-modal-dialog">
                <div class="am-modal-bd">
                    <div class="row">
                        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                            <div class="widget am-cf">
                                <div class="widget-head am-cf">
                                    <div class="widget-title am-fl">穴位录入</div>
                                    <div class="widget-function am-fr">
                                        <a href="javascript: void(0)" class="am-close am-close-spin close_a" data-am-modal-close>&times;</a>
                                    </div>
                                </div>
                                <div class="widget-body am-fr">
                                    <form class="am-form tpl-form-border-form tpl-form-border-br">

                                        <!-- 穴位编号-->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">穴位编号</label>
                                            <div class="am-u-sm-7">
                                                <input type="text" id="acupoint_id" name="acupNo" onblur="addcheck_no()" class="am-form-field tpl-form-no-bg" placeholder="请输入穴位编号,仅限英文或者数字"  required="required" />
                                            </div>
                                            <a id="add_check_acupNo" style="visibility: inherit"></a>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 穴位名称-->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">穴位名称</label>
                                            <div class="am-u-sm-7">
                                                <input type="text" id="acupoint_name" maxlength="255" name="acupName" class="am-form-field tpl-form-no-bg" onblur="addcheck_name()" placeholder="请输入穴位名称" required="required" />
                                            </div>
                                            <a id="add_check_acupoint_name" style="visibility:hidden;"></a>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 穴位功效-->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">穴位功效</label>
                                            <div class="am-u-sm-7">
                                                <textarea id="acupoint_effect" onblur="add_acupEffect()" maxlength="255" name="acupEffect" class="am-form-field tpl-form-no-bg" placeholder="请输入穴位名称" required="required"></textarea>
                                                <!-- <input type="text" id="address" class="am-form-field tpl-form-no-bg" placeholder="请输入穴位名称"  required="required" /> -->
                                            </div>
                                            <a id="add_check_acupEffect" style="visibility: inherit"></a>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 穴位说明-->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">穴位说明</label>
                                            <div class="am-u-sm-7">
                                                <textarea id="acupoint_explain" maxlength="255" name="acupInstruct" class="am-form-field tpl-form-no-bg" placeholder="请输入穴位说明，最多不超过200"  required="required"></textarea>
                                                <!-- <input type="text" id="address" class="am-form-field tpl-form-no-bg" placeholder="请输入穴位名称"  required="required" /> -->
                                            </div>
                                            <div class="am-u-sm-2">
                                                <a id="add_check_message" style="visibility: inherit"></a>
                                            </div>
                                        </div>

                                        <!-- 按钮 -->
                                        <div class="am-form-group">
                                            <span class="am-u-sm-3">
                                            </span>
                                            <div class="am-u-sm-6 am-u-sm-push-3">
                                                <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success am-u-sm-5" data-am-modal-close="">取消</button>
                                                <span class="am-u-sm-2">
                                                </span>
                                                <button type="submit" href="javascript: void(0)" id="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success am-u-sm-5" onclick="addcheck_no()" data-am-modal-close>提交</button>
                                            </div>
                                            <span class="am-u-sm-3">
                                            </span>
                                        </div>

                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 整个表单结束 -->
                </div>
            </div>
        </div>
        <!-- 添加模态框结束 -->
    <!---- 更新穴位开始--->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-2">
        <div class="am-modal-dialog">
            <div class="am-modal-bd">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">穴位录入</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript: void(0)" class="am-close am-close-spin close_a" data-am-modal-close>&times;</a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">
                                <form class="am-form tpl-form-border-form tpl-form-border-br">

                                    <!-- 穴位编号-->
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">穴位编号</label>
                                        <div class="am-u-sm-7">
                                            <input type="text" id="acupoint_id2" name="acupNo" class="am-form-field tpl-form-no-bg" readonly placeholder="请输入穴位编号,仅限英文或者数字"  required="required" />
                                        </div>
                                        <div class="am-u-sm-2">
                                            <a id="updat_check_acupNo" style="visibility: inherit"></a>
                                            <small>必填！</small>
                                        </div>
                                    </div>

                                    <!-- 穴位名称-->
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">穴位名称</label>
                                        <div class="am-u-sm-7">
                                            <input type="text" id="acupoint_name2" maxlength="255" name="acupName" class="am-form-field tpl-form-no-bg" onblur="update_check_name()" required="required"/>
                                        </div>
                                        <div class="am-u-sm-2">
                                            <a id="updat_check_acupName" style="visibility: inherit"></a>
                                            <small>必填！</small>
                                        </div>
                                    </div>

                                    <!-- 穴位功效-->
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">穴位功效</label>
                                        <div class="am-u-sm-7">
                                            <textarea id="acupoint_effect2" onblur="updat_acupEffect()" name="acupEffect" maxlength="255"  class="am-form-field tpl-form-no-bg"  placeholder="请输入穴位名称" required="required"></textarea>
                                        </div>
                                        <div class="am-u-sm-2">
                                            <a id="updat_check_acupEffect" style="visibility: inherit"></a>
                                            <small>必填！</small>
                                        </div>
                                    </div>

                                    <!-- 穴位说明-->
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">穴位说明</label>
                                        <div class="am-u-sm-7">
                                            <textarea id="acupoint_explain2" name="acupInstruct" maxlength="255" class="am-form-field tpl-form-no-bg" placeholder="请输入穴位说明，最多不超过200" onclick="no()"  required="required"></textarea>
                                        </div>
                                        <div class="am-u-sm-2">
                                            <a id="updat_check_massage" style="visibility: inherit"></a>
                                        </div>
                                    </div>

                                    <!-- 按钮 -->
                                    <div class="am-form-group">
                                            <span class="am-u-sm-3">
                                            </span>
                                        <div class="am-u-sm-6 am-u-sm-push-3">
                                            <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success am-u-sm-5" data-am-modal-close="">取消</button>
                                            <span class="am-u-sm-2">
                                                </span>
                                            <button type="submit" id="submit2" href="javascript: void(0)" class="am-btn am-btn-primary tpl-btn-bg-color-success am-u-sm-5" data-am-modal-close>提交</button>
                                        </div>
                                        <span class="am-u-sm-3">
                                            </span>
                                    </div>

                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 整个表单结束 -->
            </div>
        </div>
    </div>
    <!------更新穴位结束-------->
    <!-- 删除穴位提示警告框开始 -->
    <div class="am-modal am-modal-confirm" tabindex="-1" id="delacup">
        <div class="am-modal-dialog">
            <div class="am-modal-hd">删除警告</div>
            <div class="am-modal-bd">
                您，确定要删除这条记录吗？
            </div>
            <div class="am-modal-footer">
                <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                <span class="am-modal-btn" data-am-modal-confirm>确定</span>
            </div>
        </div>
    </div>
    <!-- 删除穴位提示警告框结束 -->
    <script src="/resources/js/amazeui.min.js"></script>
    <script src="/resources/js/amazeui.datatables.min.js"></script>
    <script src="/resources/js/dataTables.responsive.min.js"></script>
    <script src="/resources/js/jquery.min.js"></script>
    <script src="/resources/js/cookie.js"></script>
    <script src="/resources/js/app.js"></script>
    <script src="/resources/js/acupuncture.form.js"></script>
<script>
    $("#searchContent").change(function(){
        $.cookie("content",$("#searchContent").val(),1);
    });
</script>
</body>
</html>